package com.saas.after.job.entity;

import com.saas.after.job.config.Comment;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

/**
 * @Classname SupplierEntity
 * @Description TODO
 * @Date 2021/8/17 11:37
 * @Created by hjchen
 */


@Data
@Entity
@Table(name = "t_supplier")
@Comment("供应商")
@EqualsAndHashCode(callSuper = true)
public class SupplierEntity extends BaseEntity {

    @Column(length = 50)
    @Comment("供应商主数据编码")
    private String code;

    @Column(length = 50)
    @Comment("供应商名称")
    private String name;

    @Column(length = 50)
    @Comment("单位性质")
    private String unitNature;

    @Comment("状态（30 已⽣效、31 已封存、32 ⽆效）")
    @Column(length = 2)
    private Integer state;

    @Comment("联系信息")
    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "contact_id", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))
    private ContactInfo contactInfo;

}
